<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="div">hello,world</div>
<script>
    /*
    *innerHTML和innerText使用
    *outerHTML：包含外面的标签
    * */
    var div = document.querySelector("#div");
    //获取innerHTML
    console.log(div.innerHTML);
    console.log(div.outerHTML);
    //获取文本innerText
    console.log(div.innerText);
    //设置innerHTML
    div.innerHTML = "<h1>世界，你好！</h1>"
    //设置innerText
    div.innerText = "世界，你加油";
</script>
</body>
</html>